<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->


    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <link rel="stylesheet" th:href="@{/css/me.css}">
    <title>后台</title>
</head>
<body>

<div th:replace="~{commons::admin('blog')}"></div>

<div class="container">
    <div class="row">
        <a th:href="@{/admin/toAddArticle}" class="btn btn-info btn-lg" role="button">添加</a>
    </div>
    <div class="table-responsive">
        <table class="table table-striped">
            <tr>
                <td>序号</td>
                <td>标题</td>
                <td>发布日期</td>
                <td>图片地址</td>
                <td>操作</td>
            </tr>
            <tr th:each="article:${articles}">
                <td th:text="${article.getId()}"></td>
                <td th:text="${article.getTitle()}"></td>
                <td th:text="${#dates.format(article.getDate(),'yyyy-MM-dd HH:mm:ss')}"></td>
                <td th:text="${article.getImage()}"></td>
                <td>
                    <a th:href="@{/admin/toUpdateArticle(id=${article.getId()})}" type="button" class="btn btn-success">编辑</a>
                    <a th:href="@{/admin/deleteArticle(id=${article.getId()})}" type="button" class="btn btn-warning">删除</a>
                </td>
            </tr>
        </table>
    </div>


</div>



<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>

</body>
</html>